package com.v5ba.server.controller;

import com.v5ba.server.service.IWebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author yiren
 */
@Controller
@RequestMapping
public class IndexController {

    @Autowired
    private IWebService webService;

    @RequestMapping("index")
    @ResponseBody
    public String index() {
        webService.add();

        return "ok";
    }

    @RequestMapping("error")
    @ResponseBody
    public String error() {
        webService.addError();
        return "ok";
    }
}